package cdu.xjj.controller;

import cdu.xjj.pojo.dto.ClazzQueryDTO;
import cdu.xjj.pojo.vo.ClazzVO;
import cdu.xjj.result.Result;
import cdu.xjj.service.ClazzService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/clazzs")
@RequiredArgsConstructor
public class ClazzController {

    private final ClazzService clazzService;

    /**
     * 根据条件获取班级列表
     *
     */
    @GetMapping("/list")
    public Result list(ClazzQueryDTO condition) {
        log.info("条件获取班级列表:{}", condition);
        List<ClazzVO> clazzVOS = clazzService.list(condition);
        return Result.success(clazzVOS);
    }








}
